<template>
  <div class="main-page account" id="store-page" title-class="item_name">
    <!-- 标题 -->
    <!-- <van-nav-bar class="main-header" title="收益明细" :left-arrow="true" :fixed="true" :z-index="11" @click-left="onClickLeft"/> -->
    <nav-bar :title="'返利明细'"/>
    <!-- 主体内容 -->
    <div class="main-content has-header-space">
      <div class="account_index">
        <div class="account_banner">
          <div class="card">
            <h3 class="money">{{asset_info.amount}}</h3>
            <p class="money_tips">预计可返利(元)</p>
            <div class="card_tips">可提现返利<span>{{asset_info.real_balance}}</span></div>
          </div>
        </div>
        <div class="account_index_item">
          <van-cell title="分享商品返利" size="large" title-class="item_name" is-link to="/merber/account_details/rebate?type=share"/>
          <van-cell title="自购商品返利" size="large" title-class="item_name" is-link to="/merber/account_details/rebate?type=self"/>
          <van-cell title="收入明细" size="large" title-class="item_name" is-link to="/merber/account_details/income_details" />
          <van-cell title="提现记录" size="large" title-class="item_name" is-link to="/merber/account_details/record_list" />
          <van-cell title="返利结算说明" size="large" title-class="item_name" is-link  to="/merber/account_details/rebate_des"/>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import NavBar from '@/components/global/nav-bar.vue'
export default {
  components: { NavBar },
  data () {
    return {
      asset_info: {
        amount: '0.00',
        balance: '0.00',
        cash_amount: '0.00',
        day_amount: '0.00',
        month_amount: '0.00',
        real_balance: '0.00'
      },
      user_info: {}
    }
  },
  created () {
    this.getProfile()
  },
  methods: {
    getProfile () {
      return new Promise((resolve, reject) => {
        this.$Axios({ url: 'profile', method: 'get' }).then((resp) => { // 请求成功
          this.loading = false
          if (resp.return_code === '0000') {
            this.asset_info = resp.data.asset_info
            this.user_info = resp.data.user_info
          }
          resolve(resp)
        }).catch((error) => { // 请求失败
          this.$_requestInterceptor('error', error)
          reject(error)
        })
      })
    }
  }
}
</script>

<style>
</style>
